home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FishMarket 1.0
/
FishMarket v1.0.iso
/
fishies
/
126-150
/
disk_137
/
ct
/
ct.readme
< prev
next >
Wrap
Text File
|
1992-05-06
|
11KB
|
214 lines
CT IMAGE PROCESSING PROGRAM DOCUMENTATION.
The program CT is copyright 1987 by Jon Harman. It is freely
distributable as long as this documentation is included. I can be
contacted at:
Jon Harman
Imatron
389 Oyster Point Blvd.
S San Francisco, CA 94080
(415) 583-9964
I wrote this program as a tool at work to help me test out ideas.
Because I only intended it for my own use it has a very rudimentary user
interface. For this I apologize. I hope this documentation can ease some
of the difficulties.
Getting Started:
The program must be started from the CLI. It's name is CT. If the
program is unable to get enough memory to function it will say so then die.
You can specify the number of image buffers to try to open on the command
line (example: ct 2). If it can't open that many it will tell you how many
it could open. The default number of buffers is 5. The program is a
memory hog, but a 512k system can get 2 buffers if you type control-d
right at startup.
The program has a very brief help message which is displayed when you
type ?. All commands to the program start with a single letter, are followed
by 0 or more integers which select image buffers to be used by the command,
and are terminated by a return. Upper case does not equal lower case.
For example (I do not show the return needed after each line):
First get into the CT directory. Type: cd df1:ct
To start the program type: ct
To read in an image into buffer 0 type: r 0
then when it asks for the filename reply: skull.img
To display the image type: d 0
To change the scaling type: s 200 0
To display the buffer on the right side
with the new scaling type: D 0
To zoom in on the display position the cursor over
the desired point then hit the right mouse button.
To exit the program type: q
Image files on this disk:
These images are all CT scans of real people. I've included a sampling
of scans of various parts of the body. A CT scan shows anatomy as if
the patient was sliced perpendicular to his long axis. This can be a
little confusing at first. The patient's right side is on the left side
of the image.
The images are:
SKULL.IMG: A slice through the skull at the level of the eyes. Use a
wide window to see bone detail. Use a narrow window to see
soft tissue detail (s 200 0 for example.) With a narrow
window you can see the eyeballs inside the orbits. If you
look closely you can even see the optic nerve.
BRAIN5.IMG: A slice higher up showing the brain. Use s 50 50. The dark
areas are ventricles.
BRAIN8.IMG: A slice even higher than brain5. Use s 50 50.
HEART.IMG: This is an image of the chest showing the heart. Our scanner
is the only CT scanner capable of imaging the beating heart.
The patient has been injected with an iodine based contrast
solution which causes the blood to appear white. Use s 500 50.
The right ventricle is the brighest part of the heart (on the
left side in this image.) The left ventricle is to the right,
separated by the septum. The right atrium is to the lower left
of the right ventricle. The small circular object below the
heart is the descending aorta. Use s 500 -800 to see the lungs.
SPINE.IMG: This image is of the L4-5 (the space between the 4th and 5th
lumbar vertebra) region of the spine. Compared with the other
images the scale is much enlarged. The scan shows a herniated
disk. Use s 500 0.
ABD.IMG: This scan is at the level of the sacrum. Use s 400 50.
Image format:
Images are stored in files with a very simple format: a 256x256 array
of 16 bit integers. Each file is 131072 bytes long. The program assumes
the gray level data is in the low 11 bits of each word. Thus gray levels
can vary from 0 to 2047. The program maps the gray levels into a CT number
scale that ranges from -1000 to +1047. It is this CT scale that is used by
the s command to set the display scaling.
Image scaling and display:
Although the images have 11 bits of gray level information the display
has only 4 bits (16 gray levels). You specify how to map the 11 bits into
4 bits by using the s command. The command has two parameters: window and
level. The window can be any integer from 1 to 2048, the level can vary
from -1000 to 1047. The window specifies the size of the CT number range
which gets mapped to the 16 display gray levels. The level specifies the
center of the range. The defaults are window = 2048, level = 0. These
are fine for looking at the boney part of a skull but a more narrow window
is needed to see detail in brain or body tissue. A window of 100 would be
more appropriate for the brain images. The smaller the window the higher
the contrast. A window of 1 gives a black and white display with all
CT values less than or equal the level becomming black and values greater
becomming white.
You can display the image in one of two places. The d command displays
on the left side, the D command displays on the right side. Both commands
need you to specify the image buffer to be displayed. If you want to see
a portion of the display in greater detail there is a zoom command. Position
the pointer over the area to be zoomed and then either click the right mouse
button or enter z or Z.
Other functions:
I've included a variety of image processing functions. They often
produce very interesting images. The v functions are convolutions:
averaging, laplacian, unsharp masking. The e functions are edge detection
functions: absolute value of the gradient, value of the gradient in various
directions. You may have to play with the window and level values to
display these images properly. To find out what the image values are in
a region of interest use the n function. Type n <buffer number> <ret> and
place the pointer over the region of interest in the left display area.
The program will tell you the pointer position and image value at that
position. If you type return you get the values in a neighborhood of
the point. To display the region with maximum contrast choose a window
the same size as the maximum difference of CT values in the region and
choose a level equal to the median CT value in the region.
Description of commands.
? Print help message. Shows number of buffers available and their
numbering.
r <buf> Read image from file into buffer. Will ask for file name.
w <buf> Write buffer to file.
s <win> <lev> Set display scaling. Use S to automatically display the last
displayed buffer with the new scaling.
d <buf> Display buffer on left. Use D to display on right.
z Zoom in on display. Same as clicking right mouse button. Uses
the upper zoom area. Use Z to zoom to the lower zoom area.
m <buf1> <buf2> Move buf1 to buf2.
c <color> Change the color table. Table 0 is the default. Table 1 gives
negative images. Table 3 gives pseudo colors ranging from 0=blue
to 15=red. Will ask if you want to clear the display.
n <buf> Look at values of image at a point. Until you type return it will
display the x,y position of the pointer and the image CT number
at that point. Use N to skip this and just type out the CT
numbers in a neighborhood of the pointer.
i <buf> Computes mean and standard deviation of an elliptical region of
interest (ROI). Use I for a rectangular ROI. Use the right mouse
button to resize the ROI.
h <buf> Display histogram of buffer in right display. Use H if you
want to specify a subrectangle to histogram.
b Toggle screen to back. Moving the screen to the back can speed
up the computations a little.
t <buf> Generate test patterns.
a <buf1> <buf2> <buf3> Do arithmatic on buffers. The sources are buf1 and
buf2, the destination is buf3. Buf1 can equal buf2
can equal buf3.
You can choose:
+: buf3[i] = (buf1[i] + buf2[i])/ 2
-: buf3[i] = (buf1[i] - buf2[i] + 1000)
&: buf3[i] = buf1[i] & buf2[i] (and)
|: buf3[i] = buf1[i] | buf2[i] (or)
^: buf3[i] = buf1[i] ^ buf2[i] (exclusive or)
a: buf3[i] = (scale * (buf1[i] + buf2[i]) + offset)/ divsor
v <buf1> <buf2> Convolutions. You must have buf1 != buf2.
You can choose:
a: average of 9 neighbors. kernel = (1,1,1;1,1,1;1,1,1)/9.
g: gaussian average. kernel = (1,2,1;2,4,2;1,2,1)/16.
v: vertical average. kernel = (0,1,0;0,2,0;0,1,0)/4.
h: horizontal average. kernel = (0,0,0;1,2,1;0,0,0)/4.
l: laplacian. kernel = (-1,-1,-1;-1,8,-1;-1,-1,-1) + 1000.
u: unsharp mask. kernel = (-1,-1,-1;-1,24,-1;-1,-1,-1)/16.
f: a special adaptive filter. Larger threshold gives more
smoothing.
e <buf1> <buf2> Edge functions. You must have buf1 != buf2.
You can choose:
a: absolute value of gradient. (use s 400 -800 to display)
v: gradient in vertical direction. (use s 400 0 to display)
h: gradient in horizontal direction. "
d: gradient in diagonal direction. "
e: gradient in opposite diagonal direction. "
f <buf1> <buf2> Functions of binary images. You must have buf1 != buf2.
A binary image is one in which the only values are 0 or 1.
(In this case -1000 or 1047.)
You can choose:
t:threshold - create a binary image from a gray scale image.
~:complement
g:8-neighbor grow (dilation)
G:4-neighbor grow (dilation)
s:8-neighbor shrink (erosion)
S:4-neighbor shrink (erosion)
l:a special edge finding function used on laplacian images
c:contour at level
x Execute outside program. Doesn't work. I wanted to be able to
execute separately compiled programs using this command. I pass
the screen pointer and the pointers to the buffers to the new
program as hex strings via the argv array. This works fine as
long as the program doesn't try to do graphics to the screen.
Then it crashes the system. Must be blitter conflicts. Any help
on this would be appreciated.